home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 9
/
Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO
/
015a
/
bsltools.zip
/
A2B
next >
Wrap
Text File
|
1992-08-21
|
1KB
|
61 lines
PATH=/bin:/etc:/usr/bin
SHELL=/bin/sh
export PATH SHELL
OK=0
FAIL=1
###############################################################################
#
# Prompt for yes or no answer - returns non-zero for no
#
getyn() {
while echo "$* (y/n)? \c" >&2
do read yn rest
case $yn in
[Yy]) return $OK ;;
[Nn]) return $FAIL ;;
*) echo "\n\t Please answer y or n" >&2
;;
esac
done
}
###############################################################################
#
# Remove the adaptec scsi host driver from the mscsi file
#
removedvr() {
cd /etc/conf/cf.d
echo "\t Changing ad mscsi entry to btk"
mv mscsi mscsi.old
sed "s/^ad/btk/" mscsi.old > mscsi
chmod 644 mscsi
chgrp sys mscsi
rm mscsi.old
#
# Change the Y to N for the adaptec sdevice entry
# Can't use configure 'cuz there is no major no.
#
cd /etc/conf/sdevice.d
echo "\t Switching ad driver off in sdevice.d"
mv ad ad.old
sed "s/^Y/N/" ad.old >ad
chmod 644 ad
chgrp sys ad
rm ad.old
}
#################################################################################
# Main
#
[ -z "`grep \^ad /etc/conf/cf.d/mscsi`" ] || {
echo "\t The Adaptec driver ad is configured in the mscsi file "
getyn "\n\t Would you like to replace ad with btk" && {
[ -x /bin/sed ] || {
echo "ERROR: /bin/sed missing: exiting "
exit 1
}
removedvr
echo "\t You will need to relink the kernel for the"
echo "\t changes to take effect."
}
}
exit 0